# $Id: PKGBUILD 65403 2012-02-21 03:26:31Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: gh0stwizard <vitaliy.tokarev_AT_gmail.com>
# Contributor: slubman <slubman@slubman.net>

pkgname=tkabber
pkgver=0.11.1
pkgrel=3
pkgdesc="Tkabber is an open source Jabber client, written in Tcl/Tk."
arch=(any)
url="http://tkabber.jabber.ru/"
license=("GPL")
depends=('tcl' 'tk' 'bwidget' 'tcllib')
source=(http://files.jabber.ru/tkabber/tkabber-$pkgver.tar.gz
	http://files.jabber.ru/tkabber/tkabber-plugins-$pkgver.tar.gz
	tkabber)
md5sums=('718db4876e7efbf44867c845cf2a35a0'
         '1da01fafcb80083df799c92c83243b62'
         '568b7eb3199ea05bbf1cb09948d81ea7')

build() {
    mkdir -p $pkgdir/usr/share
    mkdir -p $pkgdir/usr/bin
    mv $srcdir/$pkgname-$pkgver $pkgdir/usr/share
    mv $srcdir/$pkgname-plugins-$pkgver/* $pkgdir/usr/share/$pkgname-$pkgver/plugins
    cd $pkgdir/
    msg "Repair permissions..."
    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/tkabber.tcl
#    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/examples/tkabber_setstatus
    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/examples/tclCarbonNotification-1.0.0/build.sh
#    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/jabberlib-tclxml/tclxml/sgml-8.1.tcl
#    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/jabberlib-tclxml/tclxml/sgmlparser.tcl
#    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/jabberlib-tclxml/tclxml/tclparser-8.1.tcl
#    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/jabberlib-tclxml/tclxml/xml-8.1.tcl
    chmod 755 $pkgdir/usr/share/$pkgname-$pkgver/plugins/whiteboard/svgrender.tcl
    msg "Installing tkabber script..."
    cat $srcdir/tkabber | sed -e "s/_TKABBERVER_/$pkgver/g" >> $pkgdir/usr/bin/tkabber
    chmod +x $pkgdir/usr/bin/tkabber
}
